home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 05 - 1989 / 05.03 Mar 89 / calc source / DoInit.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-12-09  |  1.3 KB  |  55 lines  |  [TEXT/KAHL]

  1.  
  2. #include <WindowMgr.h>
  3. #include <ListMgr.h>
  4. #include <OSUtil.h>
  5. #include <EventMgr.h>
  6.  
  7. #include "MacCalc.h"
  8. #include "SheetHndlg.h"
  9. #include "CalcData.h"
  10.  
  11. void CreateMenus( void ) ;
  12.  
  13. int DoInit( )
  14. {
  15.     
  16.     /* initialize all the MacIntosh Managers */ 
  17.     InitGraf( ( Ptr)&thePort ) ; /* initialize quickdraw */ 
  18.     InitFonts( ) ; /* initialize the font manager */ 
  19.     InitWindows( ) ; /* initialize the window manager */ 
  20.     InitCursor( ) ; /* initialize the cursor */ 
  21.     InitMenus( ) ; /* initialize the menu manager */ 
  22.     TEInit( ) ; /* initialize the text edit manager */ 
  23.     InitDialogs( NULL ) ; /* initialize the dialog manager */ 
  24.     
  25.     /* Flush events */
  26.     
  27.     FlushEvents( everyEvent, 0 ) ;
  28.     
  29.     /* Get curr screen size */
  30.     curr_screen = screenBits.bounds ;
  31.     SetRect( &minmax_size, 207, 77, 447, 159 ) ;
  32.  
  33.     /* Expand the heap to the maximum and allocate more masters blocks */ 
  34.     MaxApplZone( ) ; 
  35.     MoreMasters( ) ; 
  36.     MoreMasters( ) ; 
  37.     MoreMasters( ) ; 
  38.     MoreMasters( ) ; 
  39.     MoreMasters( ) ;
  40.     
  41.     CreateMenus( ) ;
  42.     
  43.     OpenNewSpreadsheet( "\pUntitled" ) ;
  44. }
  45. void CreateMenus( )
  46. {
  47.     MenuHandle menu ;
  48.     
  49.     menu = GetMenu( 1 ) ;
  50.     AddResMenu( menu, 'DRVR' ) ;
  51.     InsertMenu( menu, 0 ) ;
  52.     InsertMenu( GetMenu( 256 ), 0 ) ;
  53.     InsertMenu( GetMenu( 257 ), 0 ) ;
  54.     DrawMenuBar( ) ;
  55. }